package com.hxzy.controller;

import com.hxzy.common.vo.R;
import com.hxzy.system.dto.AdminLoginDTO;
import com.hxzy.system.feign.SystemServiceFeignClient;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

@Api(tags = "统一认证API")
@RestController
public class AuthController {


    @Autowired
    private SystemServiceFeignClient systemServiceFeignClient;

    @ApiOperation(value = "登录认证")
    @PostMapping(value = "/login")
    public R authentication(@RequestBody @Valid AdminLoginDTO adminLoginDTO){

        return this.systemServiceFeignClient.authentication(adminLoginDTO);
    }

    @ApiOperation(value = "得到当前用户信息")
    @GetMapping(value = "/info")
    public R userInfo(){
        return this.systemServiceFeignClient.userInfo();
    }

    @ApiOperation(value = "获取当前用户的动态路由信息")
    @GetMapping("/getRouters")
    public R getRouters(){
        return  this.systemServiceFeignClient.getRouters();
    }



}
